package com.hhsjdesign.dynamicui.core.widgetimpl

import android.content.Context
import android.widget.LinearLayout
import com.hhsjdesign.dynamicui.core.widgetdata.WidgetData
import com.hhsjdesign.dynamicui.core.property.widget.LinearLayoutVProperty
import com.hhsjdesign.dynamicui.core.widgetimpl.layout.LinearLayoutHWidget
import com.hhsjdesign.dynamicui.core.widgetimpl.layout.LinearLayoutVWidget

/**
 * 根布局
 */
class RootLayout : LinearLayoutVWidget {

    constructor(context: Context, widgetData: WidgetData, viewGroup: LinearLayout) : this(
        context,
        widgetData
    ) {
        childList = ArrayList()
        contentView = viewGroup
    }

    constructor(
        context: Context,
        data: WidgetData
    ) : super(context, data) {
        childList = ArrayList()
    }

    fun superMakeWidget(list: MutableList<WidgetData>) {
        canRemakeView = false
        widgetData.childData = list
        widgetData.viewProperty!!.solidInt = 0xffffffff.toInt()
        widgetData.specProperty = LinearLayoutVProperty()
        makeWidget()
    }

    fun superUpdateWidget(list: MutableList<WidgetData>) {
        makeWidget()
    }


}